<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php'),
     require(__DIR__ . '/oauth.php')
);

return [
    'id' => 'app-frontend',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'controllerNamespace' => 'frontend\controllers',
    'components' => [
        'user' => [
            'class'=>'frontend\identity\user',
           // 'identityClass' => 'common\models\User',
          //  'loginUrl'=>null,
          //  'enableAutoLogin' => false,
           
        ],
          'db'=>[
              'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=localhost;dbname=yuepao',
            'username' => 'root',
            'password' => '',
            'charset' => 'utf8',
        ],
          'redis' => [
            'class' => 'yii\redis\Connection',
            'hostname' => '192.168.5.115',
            'port' => 6379,
            'database' => 0,
        ],
        'session' => [
              'class' => 'yii\redis\Session',
             'redis' => 'redis'
         ],
        
        
        
        
        
        
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
           // 'errorAction' => 'site/error',
           // 'errorAction' => 'api/error/handle',
            'class'=>'frontend\exception\ExceptionHandler'
        ],
    ],
    'params' => $params,
    
    'modules'=>[
        'api'=>['class'=>'frontend\api\ApiModule']
    ]
];
